package iedcyt.acute.dataAccess.dao.maauco;


import iedcyt.acute.dataAccess.domain.maauco.Au0;
import iedcyt.acute.dataAccess.domain.maauco.Co0;
import iedcyt.acute.dataAccess.utils.Pair;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.ResultSetExtractor;



public class RPResultSetExtractor implements ResultSetExtractor<Pair<Au0, Co0>> {

	@Override
	public Pair<Au0, Co0> extractData(ResultSet rs) throws SQLException {
		
		int idno = rs.getInt("IDNO");
		
		Au0 au0 = new Au0(idno, -1, rs.getString("AUTH"), null/*rs.getString("4")*/);
		Co0 co0 = new Co0(idno, -1, 0, rs.getString("CORP"), rs.getString("COUNTRY"),
				rs.getString("YEAR"), rs.getString("PROVINCIA"), rs.getString("INSTIT"), 
				rs.getString("ORGANISMO"), rs.getString("DPTO"), rs.getString("ISO"), "");
		
		
		Pair<Au0, Co0> pair = new Pair<Au0, Co0>(au0, co0);
		
		return pair;
	}

}
